﻿namespace SDT.CrawlSystem.Servers.Filters
{
    /// <summary>
    /// Written by TungNX
    /// </summary>
    public partial class Filter
    {
        public enum Regions
        {
            NA, URL, WEB, HTM, TXT, TITLE, CONTENT
        };

        private static string[] StrRegions = new string[] 
        {
            "NA", "URL", "WEB", "HTM", "TXT", "TITLE", "CONTENT"
        };

        public static Regions FromString(string r)
        {
            r = r.Trim().ToUpper();
            for (int i = 0; i < StrRegions.Length; i++)
                if (r == StrRegions[i])
                    return (Regions)i;
            return Regions.NA;
        }

        protected Regions dataSource = Regions.NA;
        public Regions DataSource
        {
            get { return dataSource; }
        }
    }
}